package cn.exercise.jdbc;

import cn.exercise.controller.DogController;
import cn.exercise.pojo.Dog;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * @author :Colin
 * @version 创建时间: 2021/7/15 10:11
 */
public class TestJdbc {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/colinbase";
        Connection conn = DriverManager.getConnection(url, "root", "root");
        String sql="create table dog (name varchar(20),age int,gender varchar(20),price double) ";
        PreparedStatement ps = conn.prepareStatement(sql);
        int i = ps.executeUpdate();
        System.out.println(i);


    }
}
